import Vue from 'vue'
import App from './App.vue'

Vue.config.productionTip = false

//导入
import VueRouter from 'vue-router'
//use一下
Vue.use(VueRouter)
//导入 需要通过路由管理的组件
import discovery from "./components/discovery";
import recommendList from "./components/recommendList";
import newMusic from "./components/newMusic";
import newMv from "./components/newMv";
import result from "./components/result";
import PlayList from "./components/PlayList";
import MV from "./components/MV";
//创建路由
let router=new VueRouter({
   routes:[
    //配置地址 和 组件的对应关系
     {
       //地址
       path:'/discovery',
       //组件
       component:discovery,
     },
     {
         path:'',
         component: discovery,
      },
     {
        //地址
        path:'/recommend',
        component:recommendList,
     },
     {
         //地址
         path: '/newMusic',
         component: newMusic,

     },
     {
         //地址
         path: '/newMv',
         component: newMv,

     },
     {
         //地址
         path: '/result',
         component: result,
     },
     {
         path: '/playlist',
         component:PlayList,
     }  ,
       {
           path: '/mv',
           component: MV,
       }

   ]
})
//导入element-ui
import ElementUI from 'element-ui'
//导入element-ui的样式
import 'element-ui/lib/theme-chalk/index.css';
//使用一下
Vue.use(ElementUI);
// 设置浏览器标题
Vue.directive('title', {
    inserted: function (el, binding) {
        document.title = el.dataset.title
    }
})

new Vue({
  render: h => h(App),
  //挂载到vue实例上
  router,//router:router
}).$mount('#app')
